package Demo4;

import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-05-26
 * Time: 16:20
 */
public class Duck extends Animal implements ISwimming,IRun,IFly{
    public Duck(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat() {
        System.out.println(name + "吃鸭食");
    }

    @Override
    public void fly() {
        System.out.println(name + "在飞");
    }

    @Override
    public void run() {
        System.out.println(name + "在跑");
    }

    @Override
    public void swimming() {
        System.out.println(name + "在游泳");
    }

    @Override
    public int hashCode() {
        return Objects.hash(name,age);
    }
}
